#ifndef FORM_wzkccx_H
#define FORM_wzkccx_H

#include <QWidget>
#include <QSqlQuery>
#include <QSqlQueryModel>
#include <QJsonObject>

#include "pub_pop_get_item.h"
#include "pub_pop_delay.h"
#include "pub_sqthread.h"

namespace Ui {
class Form_wzkccx;
}

class Form_wzkccx : public QWidget
{
    Q_OBJECT

public:
    explicit Form_wzkccx(QWidget *parent = nullptr);
    ~Form_wzkccx();

    void closeEvent(QCloseEvent *event);

signals:
        void destroyW( QString );

private slots:

        bool checkStatus(int); //检查环境
        QStringList getSearch(QString mode, QString key_word);
        //void printOutExcel(QJsonObject &js); //打印药品成本消耗表
        void on_pbExit_clicked();

        void on_pbFresh_clicked();

        void on_pbSearch_clicked();

        void on_leKey_returnPressed();

        void on_pbFresh_2_clicked();

        void on_pbSearch_2_clicked();

        void on_leKey_2_returnPressed();

        void on_tabWidget_currentChanged(int index);

        void on_pbDump_clicked();

        void on_pbInventory_clicked();

        void on_pbRelate_clicked();

        void on_pbFresh_3_clicked();

private:
    Ui::Form_wzkccx *ui;

    QSqlQueryModel *mdList1, *mdList2,*mdList3,*mdList4,*mdSearchPop;;
    QSqlQuery *qrm, *qrmt, *qro;
    //QString groups, drugCode;
    QString store_depts;   //库名称与代码
    QString relate_name_code;   //库名称与代码

    QString item_code;  //当前正在操作的药品代码
    QString stock_no;   //当前正在操作的药品批次号
    QString stock_code;   //当前正在操作的药品库存流水号
    QString factory_code;  //厂家代码
    QString sq;

    Pub_pop_delay * dlgDelay;
    Pub_pop_get_item * dlgGetItem;
    sqThread * sqlThread;
    QStringList sqlMsg;

    QString dateRangeOut, dateRangeIn, dt_begin, dt_end;   //查询用到的起始日期和结束日期
    QString current_dept_code; //查询的库房代码

    QString last_query_sql;

};

#endif // FORM_wzkccx_H
